package cn.edu.thu.tsquality.core.algorithm.columnrepair;
import cn.edu.thu.tsquality.adaptor.single.SingleMultiputAdaptor;
import cn.edu.thu.tsquality.core.common.algorithm.IMultiputAlgorithm;
import cn.edu.thu.tsquality.core.common.util.ArgumentsHelper;


import java.io.IOException;
public class SingleMain {
    public static void main(String[] args) throws IOException{
        System.out.println("args length="+args.length);
        for(int i = 0; i < args.length; i++)
            System.out.println("arg[" + i + "] = " + args[i]);

        String[] arguments0 = ArgumentsHelper.getValues(args[0]);
        String[] arguments1 = ArgumentsHelper.getValues(args[1]);
        System.out.println(arguments0.length);
        System.out.println(arguments1.length);

        String type = args[2];

        String [] inputfiles = new String [2];
        inputfiles[0] = arguments0[0];
        inputfiles[1] = arguments0[1];
        String [] outputfiles = new String[2];
        outputfiles[0] = arguments1[0];
        outputfiles[1] = arguments1[1];
        IMultiputAlgorithm algorithm = new ColumnRepair(type);
        SingleMultiputAdaptor adaptor = new SingleMultiputAdaptor();
        adaptor.setAlgorithm(algorithm);
        adaptor.run(inputfiles,outputfiles);

    }

}
